/*
 * @(#)InstanceIdentifierTransformer.java
 * Date 2013-08-15
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.pix.transformer;

import javax.enterprise.context.ApplicationScoped;

import org.hl7.v3.II;

import us.hornerscorners.lamppost.model.common.InstanceIdentifier;

import us.hornerscorners.lamppost.transformer.AbstractTransformer;


/**
 *
 * @author jim
 */
@ApplicationScoped
public class InstanceIdentifierTransformer
        extends AbstractTransformer<II, InstanceIdentifier> {

    /**
     * Constructs ...
     *
     */
    public InstanceIdentifierTransformer() {
        super();
    }

    /**
     * Method description
     *
     *
     * @param id
     *
     * @return
     */
    @Override
    public InstanceIdentifier transform(II id) {

        InstanceIdentifier result = null;

        if (id != null) {

            result = new InstanceIdentifier();

            result.setAssigningAuthorityName(id.getAssigningAuthorityName());
            result.setDisplayable(id.isDisplayable());
            result.setExtension(id.getExtension());
            result.setRoot(id.getRoot());
        }

        return result;
    }
}
